import { MockMethod } from 'vite-plugin-mock';

const asyncRoutes = [
  {
    id: 100,
    type: 'dir',
    path: '/sys',
    component: '/layouts/index',
    name: 'sys',
    title: '系统管理',
    icon: 'i-ep-location',
    children: [
      {
        id: 101,
        type: 'menu',
        parentId: 100,
        path: '/sys/user',
        component: 'sys/user/index',
        name: 'user',
        title: '用户管理',
        icon: 'i-ep-user'
      },
      {
        id: 102,
        type: 'menu',
        parentId: 100,
        path: '/sys/role',
        component: 'sys/role/index',
        name: 'role',
        title: '角色管理',
        icon: 'i-ep-user'
      },
      {
        id: 103,
        type: 'menu',
        parentId: 100,
        path: '/sys/menu',
        component: 'sys/menu/index',
        name: 'menu',
        title: '菜单管理',
        icon: 'i-ep-user'
      },
      {
        id: 104,
        type: 'menu',
        parentId: 100,
        path: '/sys/dept',
        component: 'sys/dept/index',
        name: 'dept',
        title: '机构管理',
        icon: 'i-ep-user'
      },
      {
        id: 105,
        type: 'menu',
        parentId: 100,
        path: '/sys/post',
        component: 'sys/post/index',
        name: 'post',
        title: '岗位管理',
        icon: 'i-ep-user'
      },
      {
        id: 106,
        type: 'menu',
        parentId: 100,
        path: '/sys/dict',
        component: 'sys/dict/index',
        name: 'dict',
        title: '字典管理',
        icon: 'i-ep-user'
      }
    ]
  }
];

export default [
  {
    url: '/mock-api/getRoutes',
    method: 'get',
    response: (res) => {
      return {
        code: 200,
        data: asyncRoutes
      };
    }
  }
] as MockMethod[];
